In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
import pandas
import matplotlib.pyplot as plt
import numpy as np
import sunpy
import matplotlib
import seaborn as sns
from scipy import stats
import datetime


/Users/schriste/anaconda/lib/python2.7/site-packages/pytz/__init__.py:35: UserWarning: Module _imaging was already imported from /Users/schriste/anaconda/lib/python2.7/site-packages/PIL/_imaging.so, but /Users/schriste/.local/lib/python2.7/site-packages is being added to sys.path
  from pkg_resources import resource_stream

In [3]:
sns.set_color_palette("deep", desat=.6)

In [4]:
import heroespy

In [5]:
file2 = "/Users/schriste/Dropbox/Developer/HEROES/HEROES-Telescope/SAS2_pointing_data2.csv"
sas2 = pandas.read_csv(file2, parse_dates=True, index_col = 0)

In [6]:
file1 = "/Users/schriste/Dropbox/Developer/HEROES/HEROES-Telescope/SAS1_pointing_data2.csv" 
sas1 = pandas.read_csv(file1, parse_dates=True, index_col = 0)

In [7]:
sas1.describe()


WARNING: DeprecationWarning: height has been deprecated.
 [pandas.core.config]
WARNING: DeprecationWarning: height has been deprecated.
 [pandas.core.config]
Out[7]:
ctl az ctl el offset r offset x offset y pointing x pointing y
count 103820.000000 103820.000000 103820.000000 103820.000000 103820.000000 103820.000000 103820.000000
mean -0.000447 0.000319 35.810597 13.521916 -0.544368 -758.352848 98.613347
std 0.013793 0.009559 55.991746 55.375291 34.174898 139.655021 37.704426
min -0.329208 -0.050718 0.153758 -2375.628042 -243.421328 -3169.628042 -153.527507
25% -0.008497 -0.002484 17.269976 -4.666385 -13.800850 -797.662825 87.068193
50% -0.000177 0.000267 28.427181 12.031613 -0.646516 -780.940290 100.658258
75% 0.007995 0.002904 43.739924 28.787960 12.413126 -763.711287 113.737244
max 0.119334 0.940669 3478.211166 794.000000 2540.540163 123.294351 2642.540163

In [8]:
sas2


WARNING: DeprecationWarning: height has been deprecated.
 [pandas.core.config]
Out[8]:
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 50911 entries, 2013-09-21 15:21:33.292299 to 2013-09-21 22:35:37.092514
Data columns (total 7 columns):
ctl az        50911  non-null values
ctl el        50911  non-null values
offset r      50911  non-null values
offset x      50911  non-null values
offset y      50911  non-null values
pointing x    50911  non-null values
pointing y    50911  non-null values
dtypes: float64(7)

In [9]:
sas2.describe()


WARNING: DeprecationWarning: height has been deprecated.
 [pandas.core.config]
WARNING: DeprecationWarning: height has been deprecated.
 [pandas.core.config]
Out[9]:
ctl az ctl el offset r offset x offset y pointing x pointing y
count 50911.000000 50911.000000 50911.000000 50911.000000 50911.000000 50911.000000 50911.000000
mean -0.067560 -0.046707 263.531955 -173.263034 -94.142331 -823.157438 -10.654637
std 0.138514 0.020018 251.077144 299.318654 63.363317 149.533268 59.237476
min -0.456153 -0.288746 18.272917 -2725.035879 -263.406967 -3519.035879 -173.245186
25% -0.026046 -0.048349 148.462911 -149.119037 -141.848018 -920.520148 -48.239203
50% -0.011888 -0.044440 160.986738 -113.102894 -104.589028 -849.191896 -26.665613
75% -0.001577 -0.040336 178.283180 22.482410 -49.807323 -763.097341 18.339585
max 0.257438 1.037392 3872.350982 979.341288 2751.232740 185.341288 2853.232740

In [10]:
sas2['ctl az'].index[0]


Out[10]:
Timestamp('2013-09-21 15:21:33.292299', tz=None)

In [11]:
from heroespy.util import times

In [12]:
times.solarobs_target2


Out[12]:
(datetime.datetime(2013, 9, 21, 15, 35),
 datetime.datetime(2013, 9, 21, 22, 33))

Considering only the second solar target (the AR)


In [13]:
ind = sas1['ctl el'].index
time_index=ind.indexer_between_time(times.solarobs_target2[0],times.sas_pyasr_wrongtarget[0])
sas1_obs = sas1.iloc[time_index]

In [14]:
ind = sas2['ctl el'].index
time_index=ind.indexer_between_time(times.solarobs_target2[0],times.sas_pyasr_wrongtarget[0])
sas2_obs = sas2.iloc[time_index]

Create a sub dateFrame with just the times above


In [15]:
sas2_obs.plot()


Out[15]:
<matplotlib.axes.AxesSubplot at 0x10a70ed90>

In [16]:
sas1_obs.plot()


Out[16]:
<matplotlib.axes.AxesSubplot at 0x109788910>

Create new dataframes with just the AR observation


In [17]:
sas1_obs['ctl el'].plot()
sas2_obs['ctl el'].plot()


Out[17]:
<matplotlib.axes.AxesSubplot at 0x10b1d2950>

In [18]:
sas1_obs['ctl az'].plot()
sas2_obs['ctl az'].plot()


Out[18]:
<matplotlib.axes.AxesSubplot at 0x10b4d8d10>

In [19]:
y1 = sas1_obs['ctl el'].resample('60s', how=np.mean) * 60 - 2.3
y2 = sas2_obs['ctl el'].resample('60s', how=np.mean) * 60
diff = y1 - y2

In [20]:
ax = diff.plot()
ax.set_ylabel('PYASF-PYASR Elevation [arcmin]')


Out[20]:
<matplotlib.text.Text at 0x10c876b10>

In [21]:
y1 = sas1_obs['ctl az'].resample('60s', how=np.mean) * 60 - 0.64
y2 = sas2_obs['ctl az'].resample('60s', how=np.mean) * 60
diff = y1 - y2

In [22]:
ax = diff.plot()
ax.set_ylabel('PYASF-PYASR Azimuth [arcmin]')


Out[22]:
<matplotlib.text.Text at 0x10c895a10>

In [29]:
y1 = sas1['ctl el'].resample('60s', how=np.mean) * 60 - 2.3
y2 = sas2['ctl el'].resample('60s', how=np.mean) * 60
diff = y1 - y2

In [31]:
ax = diff.plot()
ax.set_ylabel('PYASF-PYASR Elevation [arcmin]')
ax.set_ybound(-0.2, 0.7)



In [32]:
import Pysolar

In [40]:
sunel = [Pysolar.GetAltitude(34.4731, -104.2422, t) for t in sas1['ctl el'].resample('60s', how=np.mean).index]

In [41]:
sunel = pandas.Series(sunel, index=sas1['ctl el'].resample('60s', how=np.mean).index)

In [45]:
ax = sunel.plot()
ax.set_title("Elevation of the Sun")
ax.set_ylabel("Degrees")


Out[45]:
<matplotlib.text.Text at 0x110045f50>

In [58]:
print(sunel.index[374])
sunel[374]


2013-09-21 21:35:00
Out[58]:
38.5615576346569

In [27]:
col = 'ctl az'
ax = sas1[col].plot()
ax.set_title("PYAS-F")
ax = sas2[col].plot(label = 'pyas-r')



In [28]:
data['ctl el'].plot()


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-28-2fc86d814966> in <module>()
----> 1 data['ctl el'].plot()

NameError: name 'data' is not defined
ERROR: NameError: name 'data' is not defined [IPython.core.interactiveshell]

In [ ]:
data

In [ ]:
data['offset x'].plot()

The jump in the data is due to the fact that we reset SAS-2 to fix RAS. The reset set the solar target back to [0,0]. This was eventually corrected.


In [ ]:
data['offset y'].plot()

In [ ]:
data['pointing x'].plot()

In [ ]:
data['pointing y'].plot()

In [ ]: